package com.yiheima.exam;

import com.yiheima.exam.Card;

public class Sliver extends Card {
    public Sliver(String cardId, String name, String phone, double money) {
        super(cardId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("消费金额：" + money);
        if(getMoney()<money*0.9){
            System.out.println("余额不足，无法消费");
            return;
        }
        setMoney(getMoney() - money*0.9);
        System.out.println("余额：" + getMoney());
}
}
